<template>
  <div>
    <el-dialog
      class="custBox"
      :visible.sync="telMasker"
      width="40%"
      @open="desc = ''"
    >
      <el-form ref="form" label-width="80px">
        <el-form-item label="通话备注">
          <el-input type="textarea" v-model="desc"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit" size="mini"
            >提交</el-button
          >
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
import { Message } from "element-ui";
import Api from "@/http/apis/modules/uses.js";
export default {
  props: {
    telMasker: {
      type: Boolean,
      default: false,
    },
    phoneNum: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      desc: null,
    };
  },
  methods: {
    async onSubmit() {
      let data = {
        userId: this.$store.state.user.userId,
        callerIdNumber: this.$store.state.user.seatsId,
        customerPhone: this.phoneNum,
        remarks: this.desc,
      };
      this.$emit("changeTel", false);
      let re = await Api.telMasket_Api(data);
      let { code, msg } = re.data;
      if (code == "SUCCESS") {
        Message({
          type: "success",
          message: msg,
        });
      } else {
        Message.error(msg);
      }
    },
  },
};
</script>
<style lang="less" scoped>
</style>